//go:build !go1.18
// +build !go1.18

package org.eliza.base.color

import com.sun.tools.javac.util.List.nil

typealias ColorLevel = UInt

var ColorLevelNone: ColorLevel = 0u
var ColorLevelBasic: ColorLevel = 1u
var ColorLevelHundreds: ColorLevel = 2u
var ColorLevelMillions: ColorLevel = 3u

// String satisfies the Stringer interface.
fun ColorLevel.String(): String {
    return when (this) {
        ColorLevelBasic -> "basic"
        ColorLevelHundreds -> "hundreds"
        ColorLevelMillions -> "millions"
        else -> "none"
    }
}

fun ColorLevel.ChromaFormatterName(): String {
    when (this) {
        ColorLevelBasic ->
            return "terminal"

        ColorLevelHundreds ->
            return "terminal256"

        ColorLevelMillions ->
            return "terminal16m"
    }
    return "noop"
}
